package com.gitee.shigen.security.mapper;

import com.gitee.shigen.security.entity.Permission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 权限表 Mapper 接口
 * </p>
 *
 * @author shigenfu
 * @since 2024-01-21
 */
public interface PermissionMapper extends BaseMapper<Permission> {

    /**
     * 获得roleName对应的权限
     * @param roleName roleName
     * @return 对应的权限列表
     */
    List<Permission> getPermissionsByRoleName(String roleName);

    /**
     * 根据roleId获得对应的权限集合
     * @param roleIds 角色集合
     * @return 权限集合
     */
    List<Permission> selectByRoleIdList(@Param("roleIds") List<Long> roleIds);
}
